NINJA ROPE 2 for UT2004
=======================

http://www.jeffwofford.com/ninjarope.html

Jeff Wofford
April 10, 2004


Ninja Rope 2 for UT2004 is a conversion of my UT2003 mutator "Ninja Rope" that works with Unreal Tournament 2004. The Ninja Rope replaces the Translocator with a sort of advanced grappling hook. This is not your grandfather's grappling hook. You can swing with the Ninja Rope, suspend yourself in mid-air, bend the rope around corners, and even harpoon other players and drag them around painfully. It's good fun.


Enabling the Ninja Rope
-----------------------

To use the Ninja Rope in an Instant Action game, or to enable it on a server you host, simply:

1) Switch to the Mutators tab in the game setup screen and add the "Ninja Rope" mutator to the list of enabled mutators.
2) Go to the Game Rules tab and make sure that the "Include Translocator" option is checked.

Now when you start the game, all players will have a Ninja Rope rather than a Translocator.


Using the Ninja Rope
--------------------

Assuming you have started or joined a game using the Ninja Rope mutator, you can bring up your Ninja Rope at any time by pushing the 'Q' key, or whatever button you have configured to bring up the Tranlocator. The Ninja Rope replaces the Translocator.

Once the Ninja Rope is selected, Fire launches the harpoon, which will stick into whatever level geometry or player it strikes.

If the harpoon hits level geometry, the Ninja Rope will automatically begin reeling itself back in, pulling you along with it. If it hits a player, it won't reel in automatically.

To start the Ninja Rope retracting, or to pause it when it is already retracting, click the AltFire button (usually your right mouse button). You can pause and resume retraction as many times as you like.

The harpoon will detach automatically when you get close to it, but you can detach it manually by clicking Fire again. This will cause the harpoon to return to its "at rest" position. Once it is fully retracted, you can fire again.


Attacking with the Ninja Rope
-----------------------------

The Ninja Rope makes for a handy way to zip around levels, but it's also a pretty effective weapon. Shoot the harpoon into another player and it will attach to them. As long as it is attached, it will do damage to them in proportion to the amount of force applied to them. In short: the harder you tug, the quicker they lose health.

The victim of a Ninja Rope attack has only two ways of freeing himself: dying, or killing the owner of the Ninja Rope.


Advanced Tactics
----------------

You can switch away to other weapons while suspended from the Ninja Rope, use them, and then switch back again. A fun strategy is to Ninja yourself up into a dark hideout near the ceiling, switch to an attacking weapon (the grenade launcher is good for this), and then wait for unsuspecting opponents to pass underneath. If you're lucky, they'll never suspect you're there.


Implementation Notes
--------------------

I tried several approaches to creating a rope simulation within the Unreal engine before deciding on this one. This approach is loosely modelled on the ninja rope weapon from Worms 2 by Team 17.

The rope consists of at least 2 nodes -- one at the player and one at the harpoon. A visual representation of the rope is drawn between those two nodes. You don't want the rope passing through the level, however, so a way of "bending" the rope is needed.

The general algorithm is: If two adjacent nodes can't see each other (that is, they are blocked by level geometry), then a new node is created between them at the corner where they first lost sight of each other.

The tricky part is finding the location to place the new node. Without going into painstaking detail, the essential algorithm is to integrate the rope position from the last frame to the new frame, noting with some accuracy the point in time and space when the rope first went from being unbroken to "bent". The new node is placed at this location.

In essence, this is all that is needed to give the rope the ability to bend and wrap around things in the world.

The rope also pulls on the player or, alternatively, the harpoon or whatever the harpoon is stuck into (such as another player). I use Hook's spring law to calculate the forces that the rope is applying to its two ends, and then apply those forces to the involved Actors.

The overall result is rather unreal-looking, so to speak, but plausible enough. There are a few illegal or ridiculous-looking situations that the Ninja Rope can get into, but they are relatively rare and tolerable.


Known Issues
------------

- Sounds and visuals need serious help.
- Bots can't use the Ninja Rope.
- Occasionally either you, or the harpoon, get stuck and it can be difficult to extract yourself.
- There is a rare type of level geometry that confuses the Ninja Rope, causing it to reset itself immediately.
- Sometimes the rope will pass through narrow obstacles even if it's physically impossible.


Help
----

I certainly welcome your comments on this or anything else you see on my site.

Moreover, I'd like to take the Ninja Rope further. As with my Flock Gun mutator, it's a bit of a shame that I don't have new art to go with the new code. If you're an experienced Unreal Engine modeller/animator and would be interested in creating a ninja rope gun model, rope model, textures, and/or "harpoon" model, please let me know at jeffwofford@yahoo.com.